/*
Code creates: 
-	Figure A.9: Expected Match Has a Government Job by Girl's Education
-	Table A.6: Determinants of Expected Match
*/

* load data
*-------------------------------------------------------------------------------

use "$data/initial_data/Expectations_roster.dta" , clear	
destring, replace

* Figure A9
*-------------------------------------------------------------------------------

lab def ed 13 "College"
lab val exp_schoolgra ed

graph bar   exp_occ if exp_schoolgra>=7 , over(exp_schoolgra) ytitle("Proportion Expecting Government Job")
graph export "$output/expectations_barchart.eps", replace


* Table A6
*-------------------------------------------------------------------------------

gen exp_badgirl=1-exp_goodgirl

* label vars
lab var exp_age_bride "Daughter's Age"
lab var exp_schoolgrade_bride "Daughter's Education"
lab var exp_badgirl "Daughter Has Male Friends"

lab var exp_occ "Expect Match with Gov Job"
lab var exp_age "Expected Age of Match"
lab var exp_ed "Expected Education of Match"
lab var exp_wealth "Expected Wealth of Match"
	
global xs "i.exp_age_bride i.exp_schoolgrade_bride  i.exp_wealth_bride exp_badgirl"	

local mtitles ""

lab var exp_schoolgrade_bride "Sch"
lab var exp_age_bride "Age"

reg exp_ed $xs , vce(cluster carer_id)
estimates store rf_exp_2
local mtitles "`mtitles' Education"

reg exp_occ $xs , vce(cluster carer_id)
estimates store rf_exp_3
local mtitles "`mtitles' "Government Job" "

reg exp_wealth $xs , vce(cluster carer_id)
estimates store rf_exp_4
local mtitles "`mtitles' Wealth"

reg exp_dowry $xs , vce(cluster carer_id)
estimates store rf_exp_5
local mtitles "`mtitles' Dowry"

reg exp_dowry $xs exp_occ exp_age exp_ed exp_wealth , vce(cluster carer_id)
estimates store rf_exp_6
local mtitles "`mtitles' Dowry"

esttab rf_exp* ,   wide b(4) se(4) label  replace mtitles(`mtitles')   star(* 0.10 ** 0.05 *** 0.01) depvars  
esttab rf_exp* using "$output/rf_exp.tex" , ///
   wide b(4) se(4) label  replace mtitles(`mtitles') booktabs  star(* 0.10 ** 0.05 *** 0.01) depvars   

